package com.wcw.example.config;

import com.wcw.example.intercept.IInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ChuangWeiwei;
 * @create 2022.10.10  17:13;
 * @Description 添加拦截器
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    IInterceptor iInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(iInterceptor);
    }
}
